<?php
	
	if(isset($_POST['license_key']) AND $_POST['license_key']=="123456"){
		require_once './card_func.php';
		//var_dump($sign->get_key($_POST['license_key']));
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<body>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css"/>
		<title>签到</title>
		<link rel="stylesheet" type="text/css" href="./css/style.css"/>
		<script src="./jquery-1.6.4.min.js"></script>


		<script language="JavaScript1.2">
	   	function ReadCard()
		{
			document.all['error'].value="";
			document.all['RETSTR'].value=SynIDCard1.getCardInfo();
			if(SynIDCard1.errorFlag=='0'){
				if(SynIDCard1.gender=='1'){
					document.all['sex'].value="男";
				}else if(SynIDCard1.gender=='2'){
					document.all['sex'].value="女";
				}
				document.all['name'].value=SynIDCard1.cust_name;
				document.all['no'].value=SynIDCard1.card_code;
				$.post("test.php",{name:SynIDCard1.cust_name,sex:SynIDCard1.gender,no:SynIDCard1.card_code,course_id:<?php echo $sign->get_key($_POST['license_key']); ?>},function(data){
					if(data=='TRUE'){
						$("#next").attr("src",'./images/true.png');
					}else{
						$("#next").attr("src",'./images/false.png');
						document.all['error'].value=data;
					}//alert(data);
				});
			}else{
				//document.all['no'].value = document.all['name'].value = document.all['sex'].value="";
				//$("#next").attr("src",'./images/1.png');

			}
		}

		function sign_in(){
			setInterval('ReadCard()',500);	
		}
		window.onload=sign_in;
		</script>
	</body>
	
	<head>
	<div id="daohui_live">
		<div class="sidebar sleft">
			<ul>
				<li>
				2	
				</li>
			</ul>
		</div>
		<div class="main_content">

			<h1>
				<a href="http://2011acm.daohui.net/" class="daohui">到会网</a>
				<span>
					<a href="">课程名：工程数学</a>
				</span>
				<span>老师: 吴常虹&#160;&#160;&#160;&#160;&#160;时间：10.8 &#160;&#160;&#160;&#160;8:00-10:30&#160;&#160;&#160;&#160;星期六</span>
			</h1>
			
			<div id="content_text">

<object classid="clsid:012DA10C-2798-46EB-8A0A-8D9E25A56A89" id="SynIDCard1" codeBase="SynID.Cab#version=1,0,0,1" width="0" height="0" >
  <param name="_Version" value="65536">
  <param name="_ExtentX" value="635">
  <param name="_ExtentY" value="582">
  <param name="_StockProps" value="0">
</object>
				<h2>
					信息：<input type="text"  value="" name="RETSTR" disabled />
				</h2>
				<h2>
					 错误：<input type="text"  value="" name="error" disabled />
				</h2>
				<h2>
					姓名：<input type="text"  value="" name="name" disabled />
				</h2>
				<h2>
					性别：<input type="text"  value="" name="sex" disabled />
				</h2>
				<h2>
					证号：<input type="text"  value="" name="no" disabled />
				</h2>

			</div><!--end content_text -->
						
			<dl class="statement">
				<dt>本步骤说明：</dt>
				<dd>输入授权码，开启签到</dd>
				<dt>驱动下载：</dt>
				<dd><a href="./驱动.zip">下载驱动</a></dd>
				<dd><a class="to_status" href="http://2011acm.daohui.net/2/status">查看流程情况&gt;&gt;</a></dd>
			</dl>
		</div>
		<div class="sidebar sright">
			<ul>
				<li><img id="next" src='./images/1.png' /></li>
			</ul>
		</div>
        
	</div>

	</head>
</html>
<?php 
}else{
?>
	<p><a href="./驱动.zip">下载驱动</a></p>
<script>
function go(){
	window.location.replace();
}
setTimeout("go()",3000);
</script>
<?php
}
?>
